[#macro header]

<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="${httpsurl}bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<!-- Theme style -->
<link rel="stylesheet" href="${httpsurl}dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
     folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="${httpsurl}dist/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="${httpsurl}assets/font-awesome/4.5.0/css/font-awesome.min.css">
[/#macro]


[#macro css src]
<link rel="stylesheet" href="${httpsurl}${src}">
[/#macro]

[#macro style src]
<link rel="stylesheet" href="${httpsurl}assets/css/${src}">
[/#macro]

[#macro script src]
<script src="${httpsurl}${src}"></script>
[/#macro]

[#macro js src]
<script src="${httpsurl}assets/js/${src}"></script>
[/#macro]

[#macro nav index]
<nav class="navbar navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <a href="${httpsurl}index.htm" class="navbar-brand"><b>好学儿</b></a>
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
                <i class="fa fa-bars"></i>
            </button>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
            <ul class="nav navbar-nav">
                <li [#if index==1] class="active" [/#if]> <a href="${httpsurl}index.htm">首页 <span class="sr-only">(current)</span></a>
                </li>
                <li [#if index==2] class="active" [/#if]> <a href="${httpsurl}article/index.htm">文章</a>
                </li>
                <li [#if index==5] class="active" [/#if]> <a href="${httpsurl}bbs/index.htm">论坛</a>
                </li>
                <li [#if index==3] class="active" [/#if]> <a href="${httpsurl}question/type/new.htm">问答</a>
                </li>
                <li [#if index==4] class="active" [/#if]> <a href="${httpsurl}activity/index.htm">活动</a>
                </li>
                [@shiro.authenticated]
                <li [#if index==7] class="active" [/#if]> <a href="${httpsurl}space/${(user.id)!'-1'}.htm">个人主页</a>
                </li>
                [/@shiro.authenticated]
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">其他 <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                            <li><a href="${siteurl}stock/index.htm">股票</a></li>
                        <li><a href="#">论坛</a></li>
                        <li><a href="#">开放平台</a></li>
                        <li><a href="#">群组</a></li>
                        <li class="divider"></li>
                        <li><a href="#">微博</a></li>
                        <li class="divider"></li>
                        <li><a href="#">开发者社区</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left" action="http://zhannei.baidu.com/cse/search" role="search">
                <input name="s" value="4524866063025472840" type="hidden">
                <input name="entry" value="1" type="hidden">
                <div class="form-group">
                    <input type="text" name="q" class="form-control" id="navbar-search-input" placeholder="搜索">
                </div>
            </form>
        </div>

        [@shiro.guest]
        <ul class="nav navbar-nav navbar-right">
            <li>
                <a href="${siteurl}login.htm">登陆</a>
            </li>
            <li>
                <a href="${siteurl}register.htm">注册</a>
            </li>
        </ul>
        [/@shiro.guest]
        <!-- /.navbar-collapse -->
        <!-- Navbar Right Menu -->
        [@shiro.user]
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <!-- Messages: style can be found in dropdown.less-->
                <li class="dropdown messages-menu">
                    <!-- Menu toggle button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-envelope-o"></i>
                        <span class="label label-success">${(user.id)!""}</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">You have 4 messages</li>
                        <li>
                            <!-- inner menu: contains the messages -->
                            <ul class="menu">
                                <li>
                                    <!-- start message -->
                                    <a href="#">
                                        <div class="pull-left">
                                            <!-- User Image -->
                                            <img src="${httpsurl}dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                                        </div>
                                        <!-- Message title and timestamp -->
                                        <h4>
                                            Support Team
                                            <small><i class="fa fa-clock-o"></i> 5 mins</small>
                                        </h4>
                                        <!-- The message -->
                                        <p>Why not buy a new awesome theme?</p>
                                    </a>
                                </li>
                                <!-- end message -->
                            </ul>
                            <!-- /.menu -->
                        </li>
                        <li class="footer"><a href="#">See All Messages</a></li>
                    </ul>
                </li>
                <!-- /.messages-menu -->

                <!-- User Account Menu -->
                <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <!-- The user image in the navbar-->
                        <img src="${(user.avatar)!''}" class="user-image" alt="">
                        <!-- hidden-xs hides the username on small devices so only the image appears. -->
                        <span class="hidden-xs">${(user.name)!""}</span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- The user image in the menu -->
                        <li class="user-header">
                            <img src="${(user.avatar)!''}" class="img-circle" alt="User Image">

                            <p>
                                <shiro.principal />代码人 - 软件工程师
                                <small>2017年6月13日</small>
                            </p>
                        </li>
                        <!-- Menu Body -->
                        <li class="user-body">
                            <div class="row">
                                <div class="col-xs-4 text-center">
                                    <a href="#">Followers</a>
                                </div>
                                <div class="col-xs-4 text-center">
                                    <a href="#">Sales</a>
                                </div>
                                <div class="col-xs-4 text-center">
                                    <a href="#">Friends</a>
                                </div>
                            </div>
                            <!-- /.row -->
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                <a href="${httpsurl}account/settings/base.htm" class="btn btn-default btn-flat">个人资料</a>
                            </div>
                            <div class="pull-right">
                                <a href="${httpsurl}signout.htm" class="btn btn-default btn-flat">退出</a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        [/@shiro.user]
        <!-- /.navbar-custom-menu -->
    </div>
    <!-- /.container-fluid -->
</nav>
[/#macro]

[#macro footer]
<footer class="main-footer">
    <div class="container">
        <div>
            <strong>Copyright &copy; 1985-${.now?string("yyyy")} <a href="https://www.haoxuer.com/">ada.young</a></strong>
            版权所有
        </div>
        <div>
            陕ICP备18011547号-1
        </div>

        <div class="row bring-up">
            [@linkType id=1 size=4]
            [#if list??]
            [#list list as type]
            <div class="col-sm-3">
                <ul class="list-unstyled">
                    <li>
                        <h4>${(type.name)!""}</h4>
                    </li>

                    [@link id=type.id size=20]
                    [#if list??]
                    [#list list as item]
                    <li><a href="${item.url!''}" target="_blank">${item.name!''}</a></li>
                    [/#list]
                    [/#if]
                    [/@link]
                </ul>
            </div>
            [/#list]
            [/#if]
            [/@linkType]
            <!-- /.col -->
        </div>
    </div>
    <!-- /.container -->
</footer>

<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?5e2e20a7ef88cc2a6787faf846c3c44e";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
[/#macro]


[#macro scripts]
<!-- jQuery 3.1.1 -->
<script src="${httpsurl}plugins/jQuery/jquery-3.1.1.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="${httpsurl}bootstrap/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="${httpsurl}plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="${httpsurl}plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="${httpsurl}dist/js/adminlte.min.js"></script>
[/#macro]



[#macro pager pageData url]
[#if pageData?? ]

<ul class="pagination">
    [#if pageData.pageNumber gt 1]
    <li><a href="${url}&pageNumber=${pageData.pageNumber-1}">上一页</a></li>
    [/#if]
    [#if pageData.totalPages gt 1]
    [#list pageData.firstNo..pageData.endNo as item]
    [#if pageData.pageNumber==item]
    <li class="active"><a href="${url}">${item}</a></li>
    [#else]
    <li><a href="${url}&pageNumber=${item}">${item}</a></li>
    [/#if]
    [/#list]
    [/#if]
    [#if pageData.pageNumber lt pageData.endNo]
    <li><a href="${url}&pageNumber=${pageData.pageNumber+1}">下一页</a></li>
    [/#if]
</ul>
[/#if]
[/#macro]

[#macro userinfo user]
<div class="box box-primary">
    <div class="box-body box-profile">
        <img class="profile-user-img img-responsive img-circle" src="${user.avatar!'dist/img/user1-128x128.jpg'}" alt="头像">

        <h3 class="profile-username text-center">${(user.name)!""}</h3>

        <p class="text-muted text-center">${(user.job)!""}</p>

        <ul class="list-group list-group-unbordered">
            <li class="list-group-item">
                <b>粉丝</b> <a class="pull-right">${(user.followers)!"0"}</a>
            </li>
            <li class="list-group-item">
                <b>关注</b> <a class="pull-right">${(user.followers)!"0"}</a>
            </li>
            <li class="list-group-item">
                <b>好友</b> <a class="pull-right">${(user.friends)!"0"}</a>
            </li>
        </ul>

        <a href="#" class="btn btn-primary btn-block"><b>关注我</b></a>
    </div>
    <!-- /.box-body -->
</div>
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">关于我</h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <strong><i class="fa fa-book margin-r-5"></i> Education</strong>

        <p class="text-muted">
            B.S. in Computer Science from the University of Tennessee at Knoxville
        </p>

        <hr>

        <strong><i class="fa fa-map-marker margin-r-5"></i> Location</strong>

        <p class="text-muted">Malibu, California</p>

        <hr>
        [#if user.labels?? ]
        <strong><i class="fa fa-pencil margin-r-5"></i> 我的标签</strong>

        <p>
            [#list user.labels as item]
            <span class="label label-info" style="margin-right: 3px;">${item.name!""}</span>
            [/#list]
        </p>
        <hr>
        [/#if]
        <strong><i class="fa fa-file-text-o margin-r-5"></i> 个人介绍</strong>

        <p>${user.note!""}</p>
    </div>
    <!-- /.box-body -->
</div>
[/#macro]